import {get, post} from './http'

// 获取所有商品的分类
export const getCates = ()=>get('/api/getcates')
 // 获取轮播图
export const getBanner =  ()=>get('/api/getbanner')
// 登录
export const getLogin = (data)=>post('/api/login',data)
// 注册
export const getReg = (data)=>post('/api/register',data)
//获取一级分类信息(首页)
export const getCate = ()=>get('/api/getcate')
// 获取商品信息(首页)
export const getHortGoods = ()=>get('/api/gethortgoods')
//获取一个商品信息
export const getGoodsInfo = (data)=>get(`/api/getgoodsinfo?id=${data}`)
// 搜索（like模糊搜索）
export const getSearch = (data)=>get(`/api/search?keywords=${data}`)

// 购物车添加
export const addCart = (data)=>post('/api/cartadd',data)
// 购物车列表
export const getCart = (params)=>get('/api/cartlist',params)
// 购物车修改
export const updateCart = (data)=>post('/api/cartedit',data)
// 购物车删除
export const delCart = (data)=>post('/api/cartdelete',data)

// 订单添加
export const addOrder = (data)=>post('/api/orderadd',data)
//地址添加
export const addAddress = (data)=>post('/api/addressadd',data)
// 地址查询
export const getAddress = (params)=>get('/api/addresslist',params)

// 订单生成
export const orderadd = (data)=>post('/api/orderadd',data)

//倒计时
export const getseckill = () => get('/api/getseckill', )

// 获取一、二级分类下的商品列表
export const getgoodlist = (params)=>get('/api/getgoodlist',params)







